if (state of button "onPortable" of window "main") is 1 then
set onOff to "true"
end if
if (state of button "onPortable" of window "main") is 0 then
set onOff to "false"
end if
set lineTwo to "defaults write Configuration GLCompositorConfiguration -dict-add GLCompositorMinimumDisplayDepth -integer " & (contents of text field "minDepth" of window "main")
set lineThree to "defaults write Configuration GLCompositorConfiguration -dict-add GLCompositorMinimumVRAM -integer " & (contents of text field "minVRAM" of window "main")
set lineFour to "defaults write Configuration GLCompositorConfiguration -dict-add GLCompositorUseOnPortable -boolean " & onOff
set lineFive to "defaults write Configuration GLCompositorConfiguration -dict-add tileHeight -integer " & (contents of text field "tileHeight" of window "main")
set lineSix to "defaults write Configuration GLCompositorConfiguration -dict-add tileWidth -integer " & (contents of text field "tileWidth" of window "main")
do shell script lineOne
do shell script lineTwo
do shell script lineThree
do shell script lineFour
do shell script lineFive
do shell script lineSix
do shell script "sudo cp $home/Library/Preferences/Configuration.plist /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/" with administrator privileges
tell application "Terminal"
do script with command "sudo cp $home/Library/Preferences/Configuration.plist /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/"